program TEST_LINEUPG;
const
  fo = 'LINEUPG.IN3';
var
  n, m, i, a, b : longint;

begin
  randomize;
  assign(output, fo); rewrite(output);

  n := 50000;
  m := 180000;
  writeln(n, ' ', m);
  for i := 1 to n do writeln(random(1000000)+1);
  for i := 1 to m do
  begin
    repeat
      a := random(n)+1;
      b := random(n)+1;
    until a <= b;
    writeln(a, ' ', b);
  end;
  close(output);
end.
